package com.nuanshui.heatedloan.baseservice.form;


import com.alibaba.fastjson.JSON;
import com.nuanshui.heatedloan.baseservice.model.UserAgent;
import com.nuanshui.heatedloan.middleware.mongodb.MongoUtil;

public class StatisticsForm {

	public StatisticsForm()
	{
		type=TYPE_SINGLE;
		op=OP_CREATE;
	}

	public static StatisticsForm create(Object obj) {
		StatisticsForm form = new StatisticsForm();
		String eventId = MongoUtil.getCollectionName(obj.getClass());
		form.setEventId(eventId);
		form.setParams(JSON.toJSONString(obj));
		return form;
	}

	public static final int TYPE_SINGLE = 0;//单行操作
	public static final int TYPE_MULTIPLE = 1;//单行操作

	public static final int OP_CREATE = 0;//单行操作
	public static final int OP_COVER = 1;//覆盖

	private UserAgent userAgent;

	private String eventId;//要操作的表

	private Integer op;//0:新增 1:覆盖
	private Integer type;//0:单行操作 1:多行操作
	private String params;
	public String getEventId() {
		return eventId;
	}
	public void setEventId(String eventId) {
		this.eventId = eventId;
	}
	public String getParams() {
		return params;
	}
	public void setParams(String params) {
		this.params = params;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public UserAgent getUserAgent() {
		return userAgent;
	}

	public void setUserAgent(UserAgent userAgent) {
		this.userAgent = userAgent;
	}

	public Integer getOp() {
		return op;
	}

	public void setOp(Integer op) {
		this.op = op;
	}

}
